package laf;

import jade.content.Concept;
import jade.content.onto.annotations.Element;
import jade.content.onto.annotations.Slot;

@Element
public class Identifier implements Concept, Comparable<Identifier> {
	private static final long serialVersionUID = 9121132515408803850L;
	protected String id;

	public Identifier() {
	}

	public Identifier(String id) {
		this.id = id;
	}

	@Slot(mandatory = true)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id.hashCode();
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Identifier other = (Identifier) obj;
		if (!id.equals(other.id))
			return false;
		return true;
	}

	@Override
	public int compareTo(Identifier other) {
		return id.compareTo(other.id);
	}
	
	@Override
	public String toString() {
		return id;
	}

}
